package fr.afcepf.atod21.projetwebservice.service.implementation;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebService;

import fr.afcepf.atod21.projetwebservice.dao.interfaces.IReservationDAO;
import fr.afcepf.atod21.projetwebservice.service.interfaces.IServiceHebergement;
/**
 * La class de gestion d'hergement.
 * @author Stagiaire
 *
 */
@Stateless
@WebService(endpointInterface = "fr.afcepf.atod21.projetwebservice.service.interfaces.IServiceHebergement",
        name = "ServiceHergementImpl")
public class ServiceHergementImpl implements IServiceHebergement {
    /**
     * chargement de l'interface.
     */
    @EJB
    private IReservationDAO iReservationDao;
    /**
     * @return the iReservationDao
     */
    public IReservationDAO getiReservationDao() {
        return iReservationDao;
    }

    /**
     * @param paramIReservationDao the iReservationDao to set
     */
    public void setiReservationDao(IReservationDAO paramIReservationDao) {
        iReservationDao = paramIReservationDao;
    }
    @Override
    public  Boolean reserverHebergement(int paramHebergementId,
            int paramNbPlaces,
           String paramDepart,
           String paramRetour) {
        return iReservationDao.reserver(paramHebergementId, paramNbPlaces, paramDepart, paramRetour);
    }

    @Override
    public Integer hebergementStockSelonHebergement(int paramHebergementId,
            String paramDepart,
            String paramRetour) {
        return iReservationDao.getStock(paramHebergementId, paramDepart, paramRetour);
    }

    @Override
    public void compenserHebergement(int paramHebergementId, int paramNbPlaces,
            String paramDepart, String paramRetour) {
        iReservationDao.compenser(paramHebergementId, paramNbPlaces, paramDepart, paramRetour);
        
    }
}
